home *** CD-ROM | disk | FTP | other *** search
- /***************************************************** IMPLEMENTATION
- DATE: 9/22/93
- AUTHOR: Eric R. Rosé
-
- CLASS: CPPGossipMonger
-
- SUPERCLASS: CPPObject
-
- This is an abstract C++ superclass for objects which live in
- windows.
-
- ********************************************************************/
-
- #pragma once
-
- #include <CPPGossipMonger.h>
-
- #define kSBarWidth 16
- #define kPageWidth 512
- #define kPageHeight 768
-
- #define kOn 1
- #define kOff 0
- #define kToggle -1
-
- #define kNoCommand 0
-
- class CPPWindow;
-
- typedef void (*ClickProcPtr)(CPPWindow *ourWindow);
-
- class CPPVisualObject : public CPPGossipMonger {
- public:
-
- CPPVisualObject (CPPWindow *itsWindow, Rect *itsBounds,
- Boolean canBeTarget = TRUE,
- Boolean active = FALSE, Boolean visible = TRUE);
- ~CPPVisualObject (void);
-
- virtual char *ClassName (void);
-
- virtual void Draw (void);
-
- virtual Boolean DoCommand (short commandID);
-
- virtual void DoIdle (void);
- virtual Boolean DoClick (EventRecord *theEvent);
- virtual Boolean DoKey (char theKey, short modifiers, short what);
-
- virtual void MakeVisible (Boolean nowVisible);
- virtual void Activate (Boolean nowActive);
- void Move (short newH, short newV);
- void Resize (short newWidth, short newHeight);
- virtual void TargetHilite (Boolean makeTarget);
- virtual void DrawHilite (void);
- virtual void EraseHilite (void);
-
- virtual Boolean InContent(Point clickPt);
- virtual Rect *GetBounds (void);
-
- void SetCommand (short theCommand);
- void SetDoClickProc (ClickProcPtr clickProc);
-
- Boolean IsVisible (void);
- Boolean IsActive (void);
- Boolean CanBeMadeTarget (void);
- void Global2Local (Point *thePoint);
-
- Boolean InColorWindow (void);
-
- protected:
- WindowPtr owningWindow;
- CPPWindow *owningWObject;
- Rect bounds;
- Boolean isActive;
- Boolean isVisible;
- Boolean isTarget;
- Boolean canBeTarget;
- ClickProcPtr doClickProc;
- short commandEquivalent;
-
- virtual void MoveContent (short newH, short newV);
- virtual void ResizeContent (short newWidth, short newHeight);
-
- };